﻿/**************************************************************************************************\
++++++++++++++++++++++++++++++ ARKADIUM INTELLECTUAL PROPERTY TERMS ++++++++++++++++++++++++++++++
The Software is protected by US copyright laws and international treaties. Licensee must treat the 
Software like any other copyrighted material – for example a book. Licensee acknowledges that 
Arkadium owns the Software and that nothing set forth herein conveys to Licensee any ownership in 
or to the Software, including without any Derivative Works of the Software.  
++++++++++++++++++++++++++++++ ARKADIUM INTELLECTUAL PROPERTY TERMS ++++++++++++++++++++++++++++++

AUTHOR: Neil Mrva

PURPOSE: This class is a singleton for universal access from any class in order to broadcast
messages with optional data. It subclasses Flash 7's EventDispatcher class which contains all the 
functionality of a basic event broadcasting system. It supports addEventListener and 
removeEventListener that are contained in EventDispatcher. 
\**************************************************************************************************/

import mx.events.EventDispatcher;

class arkadium.EventManager extends EventDispatcher
{
	
	public function EventManager()
	{
		
	}
	
	/**************************************************************************************************\
	broadcastMessage - This function is called to broadcast a message ( event name ) to all listeners 
	who subscribed to the event. The sender can also provide optional data which will be recieved by 
	the listeners.
	\**************************************************************************************************/
	public function broadcastMessage( sEventName:String, oSender:Object, oData:Object )
	{
		var oEventObject:Object = new Object();
		oEventObject.type = sEventName;
		oEventObject.target = oSender;
		oEventObject.data = oData;

		super.dispatchEvent( oEventObject );
	}
	
}